<?php
/*
 * Created on 03.07.2008
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
 class Common {
 	
 	protected $template;
 	
 	function init($template) {
 		$this->template = $template;
 	}	
 	
 	function assignCommon($template) {
 		
	$this->init($template);

	if(!$this->template->arguments['_user']) {
    	    $this->template->arguments['_user'] = new Model_User();
	}
	
	$this->template->arguments['is_logged']		= $this->template->arguments['_user']->is_logged() ? true : false;
		
    	$this->template->arguments['realname']		= $this->template->arguments['_user']->realname;
    	$this->template->arguments['user_name']		= $this->template->arguments['_user']->login;
    	$this->template->arguments['_email']			= $this->template->arguments['_user']->email;

    	$this->template->arguments['BASE_URL']		= hostname;
    	
    	$site = new Model_Site();
    	
    	$this->template->arguments['header_text'] 	= $site->header;
    	$this->template->arguments['footer_text'] 	= $site->footer;
    	$this->template->arguments['_TITLE']		= $site->title;
    	
    	$this->template->arguments['site']			= $site;
 	}
 	
 }
 
?>
